﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Hotel.WPF
{
    /// <summary>
    /// Interaction logic for Accueil.xaml
    /// </summary>
    public partial class Accueil : Window
    {
        public Accueil()
        {
            InitializeComponent();
        }

        private void bt_addControl_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                wrapPanel1.Children.Clear();
                int nb = Convert.ToInt32(tb_nbCtrl.Text);
                for (int i = 0; i < nb; i++)
                {
                    ui.Chambre.UserCtrlChambre ch = new ui.Chambre.UserCtrlChambre();
                    TextBlock t = new TextBlock();
                    t.Width = ch.Width;
                    t.Height = ch.Height;
                    t.Margin = new Thickness(0);
                    t.Inlines.Add("Chambre " + (i + 1));
                    t.Inlines.Add(new LineBreak());
                    t.Inlines.Add("Libre");
                    t.Inlines.Add(new LineBreak());
                    t.Inlines.Add("Etage");
                    ch.button1.Content = t;
                    //ch.lb_nomChambre.Content = "Chambre " + (i+1);
                    ch.Margin = new Thickness(2);

                    wrapPanel1.Children.Add(ch);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
